$OpenBSD: patch-src_pkcs11_Makefile_am,v 1.1 2016/06/07 14:08:44 dcoppa Exp $
--- src/pkcs11/Makefile.am.orig	Fri Jun  3 11:19:51 2016
+++ src/pkcs11/Makefile.am	Tue Jun  7 14:53:12 2016
@@ -1,5 +1,7 @@
 include $(top_srcdir)/win32/ltrc.inc
 
+override libdir = $(prefix)/lib/pkcs11
+
 MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo-pkcs11.rc $(srcdir)/versioninfo-pkcs11-spy.rc
 EXTRA_DIST = Makefile.mak versioninfo-pkcs11.rc.in versioninfo-pkcs11-spy.rc.in
 
@@ -24,6 +26,7 @@ opensc_pkcs11_la_LIBADD = $(OPENSC_PKCS11_LIBS)
 opensc_pkcs11_la_LDFLAGS = $(AM_LDFLAGS) \
 	-export-symbols "$(srcdir)/pkcs11.exports" \
 	-module -shared -avoid-version -no-undefined
+opensc_pkcs11_la_LIBTOOLFLAGS = --tag=disable-static
 
 onepin_opensc_pkcs11_la_SOURCES = $(OPENSC_PKCS11_SRC) $(OPENSC_PKCS11_INC)
 onepin_opensc_pkcs11_la_CFLAGS = -DMODULE_APP_NAME=\"onepin-opensc-pkcs11\" $(AM_CFLAGS)
@@ -31,6 +34,7 @@ onepin_opensc_pkcs11_la_LIBADD = $(OPENSC_PKCS11_LIBS)
 onepin_opensc_pkcs11_la_LDFLAGS = $(AM_LDFLAGS) \
         -export-symbols "$(srcdir)/pkcs11.exports" \
         -module -shared -avoid-version -no-undefined
+onepin_opensc_pkcs11_la_LIBTOOLFLAGS = --tag=disable-static
 
 pkcs11_spy_la_SOURCES = pkcs11-spy.c pkcs11-display.c pkcs11-display.h pkcs11.exports
 pkcs11_spy_la_LIBADD = \
@@ -41,6 +45,7 @@ pkcs11_spy_la_LIBADD = \
 pkcs11_spy_la_LDFLAGS = $(AM_LDFLAGS) \
 	-export-symbols "$(srcdir)/pkcs11.exports" \
 	-module -shared -avoid-version -no-undefined
+pkcs11_spy_la_LIBTOOLFLAGS = --tag=disable-static
 
 if WIN32
 opensc_pkcs11_la_SOURCES += versioninfo-pkcs11.rc
@@ -53,13 +58,4 @@ install-exec-hook:
 	for l in opensc-pkcs11.dll pkcs11-spy.dll; do \
 		mv "$(DESTDIR)$(libdir)/$$l" "$(DESTDIR)$(bindir)/$$l"; \
 	done
-else
-# see http://wiki.cacert.org/wiki/Pkcs11TaskForce
-install-exec-hook:
-	$(MKDIR_P) "$(DESTDIR)$(pkcs11dir)"
-	for l in opensc-pkcs11$(DYN_LIB_EXT) onepin-opensc-pkcs11$(DYN_LIB_EXT) pkcs11-spy$(DYN_LIB_EXT); do \
-		rm -f "$(DESTDIR)$(pkcs11dir)/$$l"; \
-		$(LN_S) ../$$l "$(DESTDIR)$(pkcs11dir)/$$l"; \
-	done
-
 endif
